/*    */ package com.cr.api.controller;
/*    */ 
/*    */

import com.cr.api.model.AddBondClueModel;
import com.cr.api.vo.SendPhoneVo;
import com.cr.business.domain.CrBondClue;
import com.cr.business.domain.CrEvidenceInfo;
import com.cr.business.dto.CreditorRightsDto;
import com.cr.business.service.ICrBondClueService;
import com.cr.business.service.ICrEvidenceInfoService;
import com.cr.common.constant.Constants;
import com.cr.common.core.controller.BaseController;
import com.cr.common.core.domain.AjaxResult;
import com.cr.common.utils.CacheUtils;
import com.cr.common.utils.http.HttpUtils;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*    */
/*    */ @Api(description = "短信接口")
/*    */ @RestController
/*    */ @RequestMapping({"/api/sms"})
         @CrossOrigin
/*    */ public class ApiSmsController extends BaseController {
/*    */
/*     */  @ApiOperation("发送短信验证码")
/*    */   @PostMapping({"/sendcode"})
/*    */   @ResponseBody
            @ApiImplicitParams({
                @ApiImplicitParam(name="phone",value = "手机号",dataType = "字符串")
            })
/*    */   public AjaxResult sendcode(@RequestBody SendPhoneVo vo) {
           int code = (int)((Math.random()*9+1)*1000);
           String params = "action=send&userid=&account=zhuiyuwang&password=zhuiyu123&mobile="+vo.getPhone()+"&content=【追鱼网】验证码"+code+",平台不会向您索取验证码,请勿泄露,谨防被骗,请在使用完成后删除此短信.有效期10分钟。&sendTime=&extno=";
           CacheUtils.put("smscode"+vo.getPhone(),code);
           HttpUtils.sendSSLPost(Constants.smsUrl,params);
/* 91 */   return AjaxResult.success();
/*    */   }
/*    */ }